package lifo.GammaTaf.SerieParallel;

import java.util.Arrays;

public interface SerieParallel {
	public void accepteVisiteur(VisitorSerieParallel visitor);

	public static class Action implements SerieParallel {
		String arg;

		public Action(String arg) {
			super();
			this.arg = arg;
		}

		public void accepteVisiteur(VisitorSerieParallel visitor) {
			visitor.visiteAction(this);
		}

		public String toString() {
			return arg;
		}

	}

	public static class Sum implements SerieParallel {
		public SerieParallel[] arg;

		public Sum(SerieParallel[] arg) {
			super();
			this.arg = arg;
		}

		public void accepteVisiteur(VisitorSerieParallel visitor) {
			visitor.visiteSum(this);
		}

		public String toString() {
			return "+" + Arrays.toString(arg);
		}
	}

	public static class Star implements SerieParallel {
		public SerieParallel arg;

		public Star(SerieParallel arg) {
			super();
			this.arg = arg;
		}

		public void accepteVisiteur(VisitorSerieParallel visitor) {
			visitor.visiteStar(this);
		}

		public String toString() {
			return "*" + arg;
		}

	}

	public static class Sharp implements SerieParallel {
		public SerieParallel arg;

		public Sharp(SerieParallel arg) {
			super();
			this.arg = arg;
		}

		public void accepteVisiteur(VisitorSerieParallel visitor) {
			visitor.visiteSharp(this);
		}

		public String toString() {
			return "#" + arg;
		}

	}

	public static class Serie implements SerieParallel {
		public SerieParallel[] arg;

		public Serie(SerieParallel[] arg) {
			super();
			this.arg = arg;
		}

		public void accepteVisiteur(VisitorSerieParallel visitor) {
			visitor.visiteSerie(this);
		}

		public String toString() {
			return "." + Arrays.toString(arg);
		}

	}

	public static class Parallel implements SerieParallel {
		public SerieParallel[] arg;

		public Parallel(SerieParallel[] arg) {
			super();
			this.arg = arg;
		}

		public void accepteVisiteur(VisitorSerieParallel visitor) {
			visitor.visiteParallel(this);
		}

		public String toString() {
			return "||" + Arrays.toString(arg);
		}

	}
}
